<!-- {if $member_from eq 'seller'}-->
		{include file=member.header.html}
        <!--{else}-->
       {include file=buyer.header.html}
        <!--{/if}-->
<script type="text/javascript" src="{res file=js/jq.lightbox.js}" charset="utf-8"></script>        
<link href="{res file=css/jq.lightbox.css}" rel="stylesheet" type="text/css" />         
<script type="text/javascript">
$(function(){
    regionInit("region");
    $('.gallery_a').lightBox();
    $('#license_end_data').datepicker({dateFormat: 'yy-mm-dd',changeMonth: true,changeYear: true});
	$(".signupForm").validate({
	  errorLabelContainer: $('#warning'),
	  rules: {
		company_name: "required",
		license_card: {
		  required: true,
          byteRange: [10,20,'{$charset}'],
          digits  :true         
		},
		license_end_data:{
			required:true
		},
		license_img: {
		  required: true
		},
		bank_address:{
			required:true
		},
        bank_card:{
			required:true
		}
	  },
	  messages: {
		company_name: "请输入企业名称",
		license_card: {
		  required: "请输入营业执照注册号",
          byteRange: "营业执照为10-20位的数字组成",
          digits: "营业执照为10-20位的数字组成"
		},
		license_end_data:{
			required:"请输入营业执照到期时间"
		},
		license_img: {
		  required: "请上传营业执照照片"
		},
		bank_address:{
			required: "请输入所在支行名称"
		},
        bank_card:{
			required: "请输入银行账号"
		}
	  }
	});
    // 上传身份证图片
    var licenseImgOption =
    {
        // 提交目标
        action: "{$site_url}/index.php?app=member&act=ajax_uploadify",
		// 服务端接收的名称
		name: "Filedata",
        // 自动提交
        autoSubmit: true,
        // 选择文件之后…
        onChange: function (file, extension) {
            if (new RegExp(/(jpg)|(jpeg)|(gif)|(png)/i).test(extension)) {
            } else {
                alert("只限上传jpg,jpeg,gif,png格式图片文件，请重新选择！");
            }
        },
        // 开始上传文件
        onSubmit: function (file, extension) {
            $("#show_license_img").html("正在上传" + file + "..");
        },
        // 上传完成之后
        onComplete: function (file, response) {
            var rs = eval("("+response+")");
            if (rs.state)
            {
                var img_url = "{$site_url}/"+rs.msg;
                $("#show_license_img").hide();
                $('img[ectype="license_img"]').attr('src', img_url);
                $('img[ectype="license_img"]').parent('.gallery_a').attr('href',img_url);
                $("#license_img").val(rs.msg);
            }
            else 
            {
                alert(rs.msg);
                $("#show_license_img").hide();
            }
            
        }
    }

    // 初始化图片上传框
    var oAjaxUpload = new AjaxUpload('#change_license_img', licenseImgOption);

});
</script>
<!-- 内容 -->
<div class="content f-cb">
  <!-- 当前位置 -->
  {include file=path.html}
  <!-- 内容左边栏 -->
  <!-- {if $member_from eq 'seller'}-->
  {include file=member.menu.html}
  <!--{else}-->
  {include file=member.menu.buyer.html}
  <!--{/if}-->
  <!-- 内容右边栏 -->
  <div class="con-r-global">
    <div class="t_1">企业认证</div>
    <div class="con-certifi-wrap">
      <div class="con-certifi-t con-certifi-ta"></div>
      <form action="" method="post" enctype="multipart/form-data" class="signupForm">
        <div id="warning"></div>
        <table class="con-certifi-table">
          <tr>
            <td align="right" width="120">用户名：</td>
            <td><em>{$user_name}</em></td>
          </tr>
          <tr>
            <td align="right"><i>*</i>企业名称：</td>
            <td><input type="text" name="company_name" class="text b-radius" maxlength="50" value="{$form_data.company_name}" />
              <span>必须与营业执照、对公账号开户名一致</span></td>
          </tr>
          <tr>
            <td align="right"><i>*</i>营业执照注册号：</td>
            <td><input type="text" name="license_card" class="text b-radius" maxlength="20" value="{$form_data.license_card}" />
              <span>请填写营业执照上的注册号</span></td>
          </tr>
          <tr>
            <td align="right"><i>*</i>营业执照到期时间：</td>
            <td><input type="text" name="license_end_data" class="text b-radius" readonly="" id="license_end_data" value="{$form_data.license_end_data}" /></td>
          </tr>
          <tr>
            <td align="right" valign="top"><i>*</i> 营业执照：</td>
            <td><table class="con-certifi-tables">
                <tr>
                  <td width="250"><ul>
                      <li> <a href="data/system/default_goods_image.gif" class="gallery_a" ><img  ectype="license_img" src="data/system/default_goods_image.gif" alt="查看大图" width="100" height="100" /></a> </li>
                      <!--后台处理后删除width属性-->
                      <li>
                        <div id="show_license_img"></div>
                        <div class="subbtn b-radius" style="width: 60px;"  id="change_license_img">上传图片</div>
                        <input type="hidden" name="license_img" id="license_img" value="" />
                      </li>
                    </ul></td>
                  <td valign="top">示例：<img src="{res file=images/member/companyid.jpg}" alt="" /></td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td align="right"><i>*</i> 开户银行：</td>
            <td><select name="bank_name" id="backaddr">
            <!--{foreach from=$cfg_bank_name item=bank key=key name=v}-->
            <option value="{$key}">{$bank}</option>
            <!--{/foreach}-->               
              </select>
              <span>只支持借记卡，必须使用本人的银行卡</span></td>
          </tr>
          <tr>
            <td align="right"><i>*</i> 开户银行所在地：</td>
            <td><div id="region">
                <input type="hidden" name="region_id" value="" id="region_id" class="mls_id" />
                <input type="hidden" name="region_name" value="" class="mls_names" />
                <select onchange="hide_error();" >
                  <option>{$lang.select_pls}</option>
                  {html_options options=$regions}
                </select>             
              </div></td>
          </tr>
          <tr>
            <td align="right"><i>*</i> 所在支行名称： </td>
            <td><input type="text" name="bank_address" class="text width_normal b-radius" maxlength="50" value="{$form_data.bank_address}" /></td>
          </tr>
          <tr>
            <td align="right"><i>*</i> 企业对公账号： </td>
            <td ><input type="text" name="bank_card" class="text width_normal b-radius" maxlength="20" value="{$form_data.bank_card}" /></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input type="submit" value="下一步" class="subbtnhsb" /></td>
          </tr>
        </table>
      </form>
    </div>
  </div>
</div>
<!-- 页脚 -->
{include file=footer.html}